ZgRNS Git Node
docs/en/usage.md HEAD (93ad7c85) Text, 3.03 KB
Usage
Start a node
Run the node from a directory that has T383838pages, T383838files and T383838node-config subdirectories, or pass explicit paths.
T282828
rns-page-node
The first run creates a new RNS identity in T383838node-config/identity and announces the destination. The node address is printed in the log.
Start with options
T282828
rns-page-node myconfig.conf Tffea00\
--pages-dir ./pages Tffea00\
--files-dir ./files Tffea00\
--media-dir ./media Tffea00\
--node-name Ta5d6ff"My Page Node" Tffea00\
--announce-interval T79c0ff60 Tffea00\
--log-level DEBUG
Run from a zipapp
If you built the offline zipapp, run it with T383838python3:
T282828
python3 dist/rns-page-node.pyz
The same flags and config file work:
T282828
python3 dist/rns-page-node.pyz myconfig.conf --log-level DEBUG
Pages
Put Micron pages in the pages directory. The file T383838index.mu becomes the home page at T383838/page/index.mu. Subdirectories work and are mapped under the page route.
Executable T383838.mu files are run as scripts. The node passes the request data as environment variables such as T383838var_action, T383838field_message and T383838field_username. The script writes its response to stdout.
A simple static T383838index.mu looks like this:
T282828
This is the home page of the node.
A dynamic T383838index.mu can read environment variables:
T282828
T8b949e#!/bin/bash
Tffa657echo Ta5d6ff"# Hello"
Tffa657echo Ta5d6ff"Ta5d6ffAction: Te6edf3$var_actionTa5d6ff"
Make the script executable and request it from a client. The node runs it and returns the stdout as the page body.
Files
Put any file in the files directory. Files are served under the T383838/file/ route and are automatically compressed if they are larger than 32 MB.
A file at T383838files/manual.pdf is requested as T383838/file/manual.pdf.
Media
NomadNet 1.4.x requests images through the T383838/media/ route. Put WebP images in the media directory and request them with a T383838path and T383838key dictionary.
A media request from a client looks like this:
T282828
Tb4b4b4{
Tff7b72"path"Tb4b4b4: Ta5d6ff"logo.webp"Tb4b4b4,
Tff7b72"key"Tb4b4b4: Ta5d6ff"site"
Tb4b4b4}
The file T383838media/logo.webp is returned. If no media directory is set, the pages directory is used.
View the node with NomadNet
After the node announces, you can browse its pages and files with a NomadNet client. Open the page destination and go to T383838/page/index.mu, T383838/file/<name> or T383838/media/<name> as needed.
The node address is printed on startup. You can also find it by looking at the announced destination in the Reticulum log.
Stop the node
Press T383838Ctrl-C. The node shuts down its announce and refresh threads cleanly.
Running as a long-lived service
For a daemon, run the node under a process supervisor such as T383838systemd, T383838runit, or T383838supervisord. The node does not daemonise itself. A minimal T383838systemd service file might look like this:
T282828
[Unit]
Description=rns-page-node
[Service]
Type=simple
WorkingDirectory=/var/lib/rns-page-node
ExecStart=/usr/local/bin/rns-page-node /etc/rns-page-node.conf
Restart=on-failure
[Install]
WantedBy=multi-user.target
Adjust the working directory, config path and user to match your system.
Served by rngit 1.5.2 - Generated in 0.02s